#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
using namespace std;
const int M = 32010;
int a[M], b[M];
int n;
int lowbit(int x)
{
    return x & (-x);
}
void insert(int xi, int v)
{
    for (int i = xi; i < M; i += lowbit(i))
    {
        a[i] += v;
    }
}
int query(int xi)
{
    int res = 0;
    for (int i = xi; i; i -= lowbit(i))
    {
        res += a[i];
    }
    return res;
}
int main()
{
    cin >> n;
    for (int i = 0; i < n; i++)
    {
        int x, y;
        cin >> x >> y;
        b[query(x + 1)]++;
        insert(x + 1, 1);
    }
    for (int i = 0; i < n; i++) cout << b[i] << endl;
    return 0;
}